/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-02-02 10:17:25
 * @LastEditors: huangtianyang
 * @LastEditTime: 2023-08-28 10:29:04
 * @FilePath: \cxl-h5\src\utils\judgeLogin.ts
 */
import { userStore } from '@/store/user.store'
import router from '@/router'

class JudgeLogin {
    _userStore: any
    constructor() {
        this._userStore = userStore()
    }

    /**
     * @param success 登录执行回调
     */
    init(success = () => {}) {
        console.log('router', router)
        if (this._userStore.loginStatus) {
            //已经登录
            success()
        } else {
            //未登录

            this._userStore.loginHintStatus = true
        }
    }
}

const useJudgeLogin = new JudgeLogin()

export default useJudgeLogin
